package 简单工厂;

public class ClientClass {
    public static void main(String[] args) {
        Factory factor = new AFactory();
        Fruit fruit = factor.CreateFruit();
        fruit.eat();
    }

    public String factory(String fruitname) {
        if (fruitname.equals("Apple")) {
            return "Apple";
        }
        if (fruitname.equals("Banana")) {
            return "Banana";
        }
        return null;
    }
}
